package com.woniuxy.yoga.evaluate.client;


import com.woniuxy.yoga.commons.core.model.Result;
import com.woniuxy.yoga.evaluate.model.dto.businessstore.BusinessStoreByAccountIdDTO;
import com.woniuxy.yoga.evaluate.model.dto.businessstore.BusinessStoreDTO;
import com.woniuxy.yoga.evaluate.model.dto.orderinfo.OrderInfoDto;
import com.woniuxy.yoga.evaluate.model.form.businessstore.UpdateScoreForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.constraints.NotNull;

@FeignClient(name = "business-service",path = "/business")
public interface BusinessClient {

    /**
     * 通过门店ID查询门店信息
     * @param storeId
     * @return
     */
    @GetMapping("/businessStore/selByStoreId/{storeId}")
    public Result<BusinessStoreDTO> selByStoreId(@PathVariable("storeId") @NotNull Integer storeId);

    /**
     * 通过门店ID修改门店评分
     * @param form
     * @return
     */
    @PostMapping("/businessStore/updateScoreById")
    public Result<String> updateScoreById(@RequestBody UpdateScoreForm form);

    /**
     * 根据商家id查询门店信息,商家状态正常、门店状态正常且已缴费
     * @param accountId
     * @return
     * @throws Exception
     */
    @GetMapping("/businessStore/selBusinessStoreByAccountId/{accountId}")
    public Result<BusinessStoreByAccountIdDTO> selBusinessStoreByAccountId(@PathVariable("accountId") Integer accountId);
}
